package com.pktechan.api.dao;

import com.pktechan.api.base.BaseMapper;
import com.pktechan.api.dto.CommissionDTO;
import com.pktechan.api.entity.CommissionGenerateFlow;
import com.pktechan.api.vo.CommissionGenerateFlowVo;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: cloudfloating
 * @description: 佣金生成流水DAO接口
 * @author: qx.zhang
 * @create: 2021-03-05 12:51
 **/
@Repository("commissionGenerateFlowMapper")
public interface CommissionGenerateFlowMapper extends BaseMapper {
    /**
     * 佣金生成明细列表
     *
     * @param custId
     * @return
     */
    List<CommissionGenerateFlowVo> getCommissionGenerateDetailsListByCustId(Integer custId);

    /**
     * 根据订单ID查询一级推荐人佣金汇总
     *
     * @param commissionGenerateFlow
     * @return
     */
    CommissionDTO getTotalCommissionByTradeOrderId(CommissionGenerateFlow commissionGenerateFlow);

    /**
     * 根据订单ID与佣金代数生成佣金流水
     *
     * @param commissionGenerateFlow
     */
    void saveCommissionGenerateFlowByTradeOrderId(CommissionGenerateFlow commissionGenerateFlow);

    /**
     * 根据订单ID与佣金代数查询已生成的佣金流水
     * @param commissionGenerateFlow
     * @return
     */
    List<CommissionGenerateFlow> getCommissionGenerateFlowListByTradeOrderId(CommissionGenerateFlow commissionGenerateFlow);
}
